﻿using System;
using System.Drawing;
using System.Windows.Forms;

namespace WinGameControls
{
    /// <summary>
    /// Replacement for System.Windows.Forms.MessageBox class.
    /// </summary>
    /// <remarks>
    /// This dialog centers itself over its owning form and displays a supplied icon.
    /// </remarks>
    public static class WinMessageBox
    {
        public static void Show (string message, string caption)
        {
            Show (null, message, caption, MessageBoxButtons.OK);
        }


        public static void Show (Icon boxIcon, string message, string caption)
        {
            Show (boxIcon, message, caption, MessageBoxButtons.OK);
        }


        public static DialogResult Show (string message, string caption, MessageBoxButtons buttons)
        {
            return Show (null, message, caption, buttons);
        }


        public static DialogResult Show (Icon boxIcon, string message, string caption, MessageBoxButtons buttons)
        {
            DialogResult result = DialogResult.None;

            using (var box = new MessageDialog (boxIcon, message, caption, buttons))
            {
                result = box.ShowDialog();
            }

            return result;
        }
    }
}
